home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Applications… / All Shapes with Printing ƒ / graphics shell.h < prev    next >
Encoding:
Text File  |  1996-03-20  |  2.2 KB  |  97 lines  |  [TEXT/KAHL]

  1. /*
  2.     interfaces for a simple, multi-window graphics shell
  3.  
  4.     ©1990 - 1992  Apple Computer, Inc.
  5.     All rights reserved.
  6.  
  7.     3/24/94 - dmh - general cleanup/debugging.
  8. */
  9.  
  10. /* the following are expected to be initialized by the application */
  11.  
  12. //all shapes.c:
  13.  
  14. extern Rect         gWindowQDRect;
  15. extern Str255        gWindowTitle;
  16. extern Boolean        gDebugging;
  17. extern Boolean        gGiveMeValidation;
  18. extern long            gGraphicsHeapSize;
  19.  
  20. //graphics shell.c:
  21.  
  22. extern Boolean            gQuitting;
  23.  
  24.  
  25. /* the following functions are supplied by the application using the shell and are called at the appropriate time. */
  26.  
  27.  
  28. /**------ Function Prototypes -----**/
  29.  
  30. //graphics shell(modified).c:
  31.  
  32. void main(void);
  33. void MyDoEvent(EventRecord *theEvent);
  34. void EventLoop(void);
  35. void MyDoEvent(EventRecord *theEvent);
  36. OSErr MyPrintingEventOverride(EventRecord *anEvent, Boolean filterEvent);
  37.  
  38. //all shapes w/printing.c:
  39.  
  40. OSErr DoInitialization(WindowPtr);
  41. void DoDraw(WindowPtr);
  42. OSErr DoCreateNew(void);
  43. void DoDispose(WindowPtr);
  44. void DoIdle(WindowPtr);
  45. void CreateSampleImage(WindowPtr);
  46.  
  47. //misc.c:
  48.  
  49. void DoMenuCommand(long menuResult);
  50. gxJob GetDocJob(WindowPtr);
  51. gxShape GetDocShape(WindowPtr);
  52.  
  53. //printing.c:
  54.  
  55. void  SetUpEditMenuRec(gxEditMenuRecord *);
  56. OSErr DoFormat(WindowPtr, gxDialogResult    *);
  57. OSErr DoPrinting(WindowPtr);
  58. OSErr DoPrintLoop(WindowPtr);
  59. OSErr DoPrintOneCopy(WindowPtr);
  60. OSErr MyReplaceCollectionItem(void *newData, long collectSize,
  61.                               OSType collectType, long collectID,
  62.                               Collection whichCollection,
  63.                               Ptr *oldData, long *oldDataSize);
  64.  
  65.  
  66. // resource & menu item equates:
  67.  
  68. #define rMenuBar        128
  69. #define mApple            128
  70. #define     iAbout        1
  71.  
  72. #define mFile            129
  73. #define     iNew        1
  74. #define     iOpen        2
  75. #define     iClose        3
  76. #define     iSave        4
  77. #define     iPageSetup    6
  78. #define     iPrint        7
  79. #define     iPrintOne    8
  80. #define     iQuit        10
  81.  
  82. #define mEdit            130
  83. #define     iUndo        1
  84. #define     iCut        3
  85. #define     iCopy        4
  86. #define     iPaste        5
  87. #define     iClear        6
  88.  
  89.  
  90. // This is the structure we use to hold our private data for each window.  We store a handle to one of these beasties
  91. // in each window's refCon field.
  92.  
  93. typedef struct {
  94.               gxJob        docJob;        // print job for this document.
  95.               gxShape    docPage;    // page gxShape description for this document.
  96.             } T_Doc, *TP_Doc, **TH_Doc;
  97.